package router

import (
	"github.com/gin-gonic/gin"

	"mxshop-api/order-web/api/order"
	"mxshop-api/order-web/global"
	"mxshop-api/shared/auth"
)

func InitOrderRouter(router *gin.RouterGroup) {
	signingKey := global.ServerConfig.SigningKey
	OrderRouter := router.Group("/order").Use(auth.Middleware(signingKey))
	{
		OrderRouter.GET("", order.List)       // 订单列表
		OrderRouter.POST("", order.New)       // 新建订单
		OrderRouter.GET("/:id", order.Detail) // 订单详情
	}
}
